package cn.cy.structure.d02Dynamic.jdk;

import java.lang.reflect.Proxy;

public class JdkDynamicProxyTest {

    public static void main(String[] args) throws Exception {
        UserService proxy = (UserService) Proxy.newProxyInstance(JdkDynamicProxyTest.class.getClassLoader(),
                new Class<?>[]{UserService.class},
                new MyInvocationHandler(new UserServiceImpl()));
        proxy.execute();
    }

}
